package com.asset.salesforce.service;

import java.util.List;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;

import com.asset.salesforce.dao.JoinRequestDaoImpl;
import com.asset.salesforce.domain.Employee;
import com.asset.salesforce.domain.JoinRequest;;

@Service
@Transactional(readOnly=true)
public class JoinRequestService {
	
	@Autowired
	JoinRequestDaoImpl joinRequestDaoImpl;
	
	@Transactional(readOnly=false)
	public void addJoinRequest(JoinRequest joinRequest) {
		joinRequestDaoImpl.addJoinRequest(joinRequest);
	}
	public List<JoinRequest> getJoinRequestsByOwnerId(Integer ownerId) {
		return joinRequestDaoImpl.getJoinRequestByOwnerId(ownerId);
		
	}
	
	@Transactional(readOnly=false)
	public void deleteJoinRequest(Integer id){
		joinRequestDaoImpl.deleteJoinRequest(id);
	}
	public JoinRequest getJoinRequest(Integer id) {
		return joinRequestDaoImpl.getJoinRequest(id);
	}
	
	@Transactional(readOnly=false)
	public void saveOrupdate(JoinRequest joinRequest){
		joinRequestDaoImpl.saveOrupdate(joinRequest);
	}

	@Transactional(readOnly=true)
	public void getJoinRquestNo(HttpSession session, Model model){
		joinRequestDaoImpl.getJoinRquestNo(session, model);
	}
	
	@Transactional(readOnly=true)
	public void getJoinRquestNum(Employee employee) {
		joinRequestDaoImpl.getJoinRquestNum(employee);
	}
	@Transactional(readOnly=true)
	public JoinRequest getJoinRequestByEmpId(Integer Emp){
		return joinRequestDaoImpl.getJoinRequestByEmpId(Emp);
	}

}
